package com.lwq.commentTool.model;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class CookModel {
	private Map<String,CookBlockModel> Datas = null;
	public CookModel() {
		if(Datas == null){
			Datas = new HashMap<String,CookBlockModel>();
		}
	}
	
	public Map<String,CookBlockModel> getDatas() {
		return Datas;
	}
	
	public void setDatas(Map<String,CookBlockModel> datas) {
		Datas = datas;
	}
	public String getRandomText(String type) {
		String randomText = null;
		if(Datas != null){
			Iterator iterator  = Datas.keySet().iterator();
			CookBlockModel block = null;
			while(iterator.hasNext()){
				block = Datas.get(iterator.next());
				if(randomText == null){
					randomText = block.getRandomText(type);
				}else{
					randomText += block.getRandomText(type);
				}
			}
		}
		return randomText;
	}
}
